this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};(function(t,e,i,n,s,a,l){"use strict";var r,o,d,u,c;var h=function(){function t(e){babelHelpers.classCallCheck(this,t);this.title=e.title;this.phone=e.phone;this.type=e.type;this.item=e.item;this.url=e.url;this.disabled=e.disabled||false;this.isEditMode=false;this.$container=null;this.$containerInput=null;this.$containerTitle=null;this.$containerEditIcon=null;this.adjustCloseEditByClick=this.adjustCloseEditByClick.bind(this);this.adjustCloseEditByKeyDown=this.adjustCloseEditByKeyDown.bind(this)}babelHelpers.createClass(t,[{key:"getContainerEdit",value:function t(){if(!this.$containerEditIcon){this.$containerEditIcon=l.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__title-edit"></div>'])))}return this.$containerEditIcon}},{key:"adjustEditMode",value:function t(){this.isEditMode?this.closeEdit():this.openEdit()}},{key:"openEdit",value:function t(){this.isEditMode=true;this.getContainer().classList.add("--edit");this.getContainerInput().select();this.getContainerInput().focus();this.getContainerInput().value=this.title;l.Event.bind(document.body,"click",this.adjustCloseEditByClick);l.Event.bind(document.body,"keydown",this.adjustCloseEditByKeyDown)}},{key:"adjustCloseEditByClick",value:function t(e){if(e.type!=="click"){return}if(e.target!==this.getContainerInput()&&e.target!==this.getContainerEdit()){this.closeEdit()}}},{key:"adjustCloseEditByKeyDown",value:function t(e){if(e.type!=="keydown"){return}if(e.keyCode===27){this.closeEdit();return}if(e.keyCode===13){this.closeEdit();this.updateTitle(this.getContainerInput().value)}}},{key:"closeEdit",value:function t(){this.isEditMode=false;this.getContainer().classList.remove("--edit");l.Event.unbind(document.body,"click",this.adjustCloseEditByClick);l.Event.unbind(document.body,"keydown",this.adjustCloseEditByKeyDown)}},{key:"updateTitle",value:function t(e){if(this.getContainerInput().value!==this.getContainerTitle().innerText&&this.getContainerInput().value!==""){this.title=e;this.getContainerTitle().innerText=e;var i=this.type[0].toUpperCase()+this.type.slice(1);s.EventEmitter.emit("BX.Landing.SiteTile:update"+i,{item:this.item,title:this.title})}}},{key:"getContainerInput",value:function t(){if(!this.$containerInput){this.$containerInput=l.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['<input\n\t\t\t\tvalue="','"\n\t\t\t\ttype="text"\n\t\t\t\tclass="landing-sites__title-input">\n\t\t\t'])),l.Text.encode(this.title))}return this.$containerInput}},{key:"getContainerTitle",value:function t(){if(!this.$containerTitle){var e;if(this.phone){e=this.phone}if(this.title){e=this.title}this.$containerTitle=l.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__title-text --sub">\n\t\t\t\t\t',"\n\t\t\t\t</div>"])),l.Text.encode(e))}return this.$containerTitle}},{key:"getContainer",value:function t(){if(!this.$container){if(this.disabled){this.$container=l.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="landing-sites__title">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t</span>\n\t\t\t\t"])),this.getContainerInput(),this.getContainerTitle())}else{this.$container=l.Tag.render(c||(c=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<a href="','" class="landing-sites__title">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t</a>\n\t\t\t\t"])),this.url,this.getContainerInput(),this.getContainerTitle(),this.getContainerEdit())}}return this.$container}}],[{key:"getTitle",get:function t(){return this.title}}]);return t}();var g,p,v,_;var T=function(){function t(e){babelHelpers.classCallCheck(this,t);this.id=e.id;this.item=e.item;this.articles=e.articles||[];this.$container=null;this.$containerClose=null;this.adjustCloseEditByClick=this.adjustCloseEditByClick.bind(this);this.adjustCloseEditByKeyDown=this.adjustCloseEditByKeyDown.bind(this)}babelHelpers.createClass(t,[{key:"show",value:function t(){this.getContainer().classList.add("--show");l.Event.bind(document.body,"click",this.adjustCloseEditByClick);l.Event.bind(document.body,"keydown",this.adjustCloseEditByKeyDown);s.EventEmitter.emit("BX.Landing.SiteTile:showLeadership",this.item)}},{key:"hide",value:function t(){this.getContainer().classList.remove("--show");l.Event.unbind(document.body,"click",this.adjustCloseEditByClick);l.Event.unbind(document.body,"keydown",this.adjustCloseEditByKeyDown);s.EventEmitter.emit("BX.Landing.SiteTile:hideLeadership",this.item)}},{key:"adjustCloseEditByClick",value:function t(e){if(e.type!=="click"){return}if(!e.target.closest(".landing-sites__helper-"+this.id)&&e.target.className!=="landing-sites__preview-leadership-text"){this.hide()}}},{key:"adjustCloseEditByKeyDown",value:function t(e){if(e.type!=="keydown"){return}if(e.keyCode===27){this.hide()}}},{key:"getContainerClose",value:function t(){if(!this.$containerClose){this.$containerClose=l.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__helper-close-toggler">',"</div>\n\t\t\t"])),l.Loc.getMessage("LANDING_SITE_TILE_HIDE"));l.Event.bind(this.$containerClose,"click",this.hide.bind(this))}return this.$containerClose}},{key:"getContainer",value:function t(){if(!this.$container){var e=l.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__helper-list"></div>'])));for(var i=0;i<this.articles.length;i++){var n=this.articles[i];e.appendChild(l.Tag.render(v||(v=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="landing-sites__helper-item ','">\n\t\t\t\t\t\t<div class="landing-sites__helper-item-title">','</div>\n\t\t\t\t\t\t<div class="landing-sites__helper-item-container">\n\t\t\t\t\t\t\t<div class="landing-sites__helper-item-text">','</div>\n\t\t\t\t\t\t\t<div class="landing-sites__helper-item-button ','"">\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t"])),n.read?"--read":"",n.title,n.text,n.read?"--read":"",n.read?l.Loc.getMessage("LANDING_SITE_TILE_READ"):l.Loc.getMessage("LANDING_SITE_TILE_TO_READ")))}this.$container=l.Tag.render(_||(_=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__helper landing-sites__helper-','">\n\t\t\t\t\t<div class="landing-sites__helper-title">\n\t\t\t\t\t\t<div class="landing-sites__helper-title-text">',"</div>\n\t\t\t\t\t\t",'\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="landing-sites__helper-container">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),this.id,l.Loc.getMessage("LANDING_SITE_TILE_LEADERSHIP_TITLE"),this.getContainerClose(),e)}return this.$container}}]);return t}();var b,m,f,C,S,L,E,y,I,k,P,w,$,D,N,U;var H=function(){function t(e){babelHelpers.classCallCheck(this,t);this.id=e.id;this.url=e.url;this.itemObj=e.itemObj;this.fullUrl=e.fullUrl;this.ordersUrl=e.ordersUrl;this.indexEditUrl=e.indexEditUrl;this.notPublishedText=e.notPublishedText;this.qr=null;this.$container=null;this.$containerClose=null;this.$containerFirstStep=null;this.$containerSecondStep=null;this.$containerQr=null;this.$containerQrimage=null;this.$containerInputUrl=null;this.$containerCopyLink=null;this.$containerTestOrder=null;this.adjustCloseEditByClick=this.adjustCloseEditByClick.bind(this);this.adjustCloseEditByKeyDown=this.adjustCloseEditByKeyDown.bind(this)}babelHelpers.createClass(t,[{key:"hide",value:function t(){this.getContainer().classList.remove("--show");l.Event.unbind(document.body,"click",this.adjustCloseEditByClick);l.Event.unbind(document.body,"keydown",this.adjustCloseEditByKeyDown);s.EventEmitter.emit(this,"BX.Landing.SiteTile.Popup:onHide",this)}},{key:"show",value:function t(e){this.getContainer().classList.add("--show");if(e==="link"){this.getContainerFirstStep().style.display="none";this.getContainerSecondStep().style.display="none";this.getContainerNotPublished().style.display="none";this.getContainerQr().style.display=null}else if(e==="notPublished"){this.getContainerFirstStep().style.display="none";this.getContainerSecondStep().style.display="none";this.getContainerQr().style.display="none";this.getContainerNotPublished().style.display=null}else{this.getContainerQr().style.display="none";this.getContainerNotPublished().style.display="none";this.getContainerFirstStep().style.display=null;this.getContainerSecondStep().style.display=null}l.Event.bind(document.body,"click",this.adjustCloseEditByClick);l.Event.bind(document.body,"keydown",this.adjustCloseEditByKeyDown);s.EventEmitter.emit(this,"BX.Landing.SiteTile.Popup:onShow",this)}},{key:"adjustCloseEditByClick",value:function t(e){if(e.type!=="click"){return}if(e.target.closest(".landing-sites__popup")||e.target.closest(".landing-sites__container-link-"+this.id)||e.target.closest(".landing-sites__status-"+this.id)){return}this.hide()}},{key:"adjustCloseEditByKeyDown",value:function t(e){if(e.type!=="keydown"){return}if(e.keyCode===27){this.hide()}}},{key:"showSecondStep",value:function t(){this.getContainerFirstStep().classList.add("--hide-right");this.getContainerSecondStep().classList.remove("--hide-left")}},{key:"showFirstStep",value:function t(){this.getContainerFirstStep().classList.remove("--hide-right");this.getContainerSecondStep().classList.add("--hide-left")}},{key:"getContainerInputUrl",value:function t(){if(!this.$containerInputUrl){this.$containerInputUrl=l.Tag.render(b||(b=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<input \n\t\t\t\t\ttype="text" \n\t\t\t\t\tstyle="position: absolute; opacity: 0; pointer-events: none"\n\t\t\t\t\tvalue="','">\n\t\t\t'])),this.fullUrl)}return this.$containerInputUrl}},{key:"getContainerCopyLink",value:function t(){var e=this;if(!this.$containerCopyLink){this.$containerCopyLink=l.Tag.render(m||(m=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__popup-copy">\n\t\t\t\t\t',"\n\t\t\t\t</div>\n\t\t\t"])),l.Loc.getMessage("LANDING_SITE_TILE_POPUP_COPY_LINK"));l.Event.bind(this.$containerCopyLink,"click",(function(){e.getContainerInputUrl().select();document.execCommand("copy");BX.UI.Notification.Center.notify({content:l.Loc.getMessage("LANDING_SITE_TILE_POPUP_COPY_LINK_COMPLETE"),autoHideDelay:2e3})}))}return this.$containerCopyLink}},{key:"getContainerQrImage",value:function t(){var e=l.Tag.render(f||(f=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="landing-sites__popup-image"></div>\n\t\t'])));new QRCode(e,{text:this.fullUrl,width:250,height:250});return e}},{key:"getContainerQr",value:function t(){if(!this.$containerQr){var e=l.Tag.render(C||(C=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__popup-close"></div>'])));l.Event.bind(e,"click",this.hide.bind(this));var i=this.indexEditUrl.startsWith("/shop/");var n=i?l.Loc.getMessage("LANDING_SITE_TILE_POPUP_TEST_ORDER_ACTION_3"):l.Loc.getMessage("LANDING_SITE_TILE_POPUP_SITE_TEXT");var s=i?l.Loc.getMessage("LANDING_SITE_TILE_POPUP_OPEN_SHOP"):l.Loc.getMessage("LANDING_SITE_TILE_POPUP_OPEN_SITE");this.$containerQr=l.Tag.render(S||(S=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__popup-container --qr">\n\t\t\t\t\t','\n\t\t\t\t\t<div class="landing-sites__popup-wrapper">\n\t\t\t\t\t\t<div class="landing-sites__popup-content">\n\t\t\t\t\t\t\t<div class="landing-sites__popup-text">\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t",'\n\t\t\t\t\t\t\t<div class="landing-sites__popup-buttons">\n\t\t\t\t\t\t\t\t<a href="','" target="_blank" class="ui-btn ui-btn-light-border ui-btn-round">\n\t\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="landing-sites__popup-bottom">\n\t\t\t\t\t\t\t<a href="','" target="_blank" class="landing-sites__popup-url">\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t","\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),e,n,this.getContainerQrImage(),this.fullUrl,s,this.fullUrl,this.url,this.getContainerInputUrl(),this.getContainerCopyLink())}return this.$containerQr}},{key:"getContainerTestOrder",value:function t(){if(!this.$containerTestOrder){this.$containerTestOrder=l.Tag.render(L||(L=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span class="ui-btn ui-btn-success ui-btn-round">\n\t\t\t\t\t',"\n\t\t\t\t</span>\t\n\t\t\t"])),l.Loc.getMessage("LANDING_SITE_TILE_POPUP_CREATE_TEST_ORDER"));l.Event.bind(this.$containerTestOrder,"click",this.showSecondStep.bind(this))}return this.$containerTestOrder}},{key:"getContainerFirstStep",value:function t(){if(!this.$containerFirstStep){var e=l.Tag.render(E||(E=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__popup-close"></div>'])));l.Event.bind(e,"click",this.hide.bind(this));this.$containerFirstStep=l.Tag.render(y||(y=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__popup-container">\n\t\t\t\t\t','\n\t\t\t\t\t<div class="landing-sites__popup-wrapper">\n\t\t\t\t\t\t<div class="landing-sites__popup-title">\n\t\t\t\t\t\t\t<span class="landing-sites__popup-title-text">\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="landing-sites__popup-content">\n\t\t\t\t\t\t\t<div class="landing-sites__popup-text">\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="landing-sites__popup-image --first-order"></div>\n\t\t\t\t\t\t\t<div class="landing-sites__popup-buttons">\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\t<a href="','" class="ui-btn ui-btn-light-border ui-btn-round">\n\t\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),e,l.Loc.getMessage("LANDING_SITE_TILE_POPUP_CREATE_TEST_ORDER"),l.Loc.getMessage("LANDING_SITE_TILE_POPUP_TEST_ORDER_TEXT"),this.getContainerTestOrder(),this.ordersUrl,l.Loc.getMessage("LANDING_SITE_TILE_POPUP_OPEN_CRM"))}return this.$containerFirstStep}},{key:"getContainerSecondStep",value:function t(){if(!this.$containerSecondStep){var e=l.Tag.render(I||(I=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__popup-close"></div>'])));var i=l.Tag.render(k||(k=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__popup-prev"></div>'])));l.Event.bind(e,"click",this.hide.bind(this));l.Event.bind(i,"click",this.showFirstStep.bind(this));this.$containerSecondStep=l.Tag.render(P||(P=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__popup-container --hide-left">\n\t\t\t\t\t',"\n\t\t\t\t\t",'\n\t\t\t\t\t<div class="landing-sites__popup-wrapper">\n\t\t\t\t\t\t<div class="landing-sites__popup-title">\n\t\t\t\t\t\t\t<span class="landing-sites__popup-title-text">','</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="landing-sites__popup-content">\n\t\t\t\t\t\t\t<div class="landing-sites__popup-text">\n\t\t\t\t\t\t\t\t<div class="landing-sites__popup-text --list"><span>1</span> ','</div>\n\t\t\t\t\t\t\t\t<div class="landing-sites__popup-text --list"><span>2</span> ',"</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t",'\n\t\t\t\t\t\t\t<div class="landing-sites__popup-buttons">\n\t\t\t\t\t\t\t\t<a href="','" class="ui-btn ui-btn-success ui-btn-round">\n\t\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),e,i,l.Loc.getMessage("LANDING_SITE_TILE_POPUP_TEST_ORDER"),l.Loc.getMessage("LANDING_SITE_TILE_POPUP_TEST_ORDER_ACTION_1"),l.Loc.getMessage("LANDING_SITE_TILE_POPUP_TEST_ORDER_ACTION_2"),this.getContainerQrImage(),this.ordersUrl,l.Loc.getMessage("LANDING_SITE_TILE_POPUP_OPEN_CRM"))}return this.$containerSecondStep}},{key:"getContainerNotPublished",value:function t(){var e=this;if(!this.$containerNotPublished){var i=l.Tag.render(w||(w=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__popup-close"></div>'])));l.Event.bind(i,"click",this.hide.bind(this));var n=l.Tag.render($||($=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span href="','" class="ui-btn ui-btn-success ui-btn-round">\n\t\t\t\t\t',"\n\t\t\t\t</span>\n\t\t\t"])),this.ordersUrl,l.Loc.getMessage("LANDING_SITE_TILE_NOT_PUBLISHED_BUTTON_PUBLISH"));l.Event.bind(n,"click",(function(){s.EventEmitter.emit("BX.Landing.SiteTile:publish",e.itemObj);e.hide()}));var a=l.Tag.render(D||(D=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span href="','" class="ui-btn ui-btn-light-border ui-btn-round">\n\t\t\t\t\t',"\n\t\t\t\t</span>\n\t\t\t"])),this.ordersUrl,l.Loc.getMessage("LANDING_SITE_TILE_NOT_PUBLISHED_BUTTON_OPEN"));l.Event.bind(a,"click",(function(){if(e.indexEditUrl){window.location.href=e.indexEditUrl}}));this.$containerNotPublished=l.Tag.render(N||(N=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__popup-container --not-published">\n\t\t\t\t\t','\n\t\t\t\t\t<div class="landing-sites__popup-wrapper">\n\t\t\t\t\t\t<div class="landing-sites__popup-title">\n\t\t\t\t\t\t\t<span class="landing-sites__popup-title-text">\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="landing-sites__popup-content">\n\t\t\t\t\t\t\t<div class="landing-sites__popup-text">\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="landing-sites__popup-buttons">\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),i,this.notPublishedText?this.notPublishedText.title:"title",this.notPublishedText?this.notPublishedText.message:"message",n,a)}return this.$containerNotPublished}},{key:"getContainer",value:function t(){if(!this.$container){this.$container=l.Tag.render(U||(U=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__popup">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\t","\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),this.getContainerFirstStep(),this.getContainerSecondStep(),this.getContainerQr(),this.getContainerNotPublished())}return this.$container}}]);return t}();var x,B,M,O,A,R,G,j,X,K,W,F,Q,z,Y,q,V,J,Z,tt,et;var it=function(){function t(e){babelHelpers.classCallCheck(this,t);this.id=e.id;this.grid=e.grid;this.title=e.title;this.url=e.url;this.fullUrl=e.fullUrl;this.domainProvider=e.domainProvider;this.pagesUrl=e.pagesUrl;this.ordersUrl=e.ordersUrl;this.domainUrl=e.domainUrl;this.contactsUrl=e.contactsUrl;this.indexEditUrl=e.indexEditUrl;this.ordersCount=e.ordersCount;this.phone=e.phone;this.preview=e.preview;this.cloudPreview=e.cloudPreview;this.published=e.published;this.deleted=e.deleted;this.domainStatus=e.domainStatus;this.domainStatusMessage=e.domainStatusMessage;this.menuItems=e.menuItems||[];this.menuBottomItems=e.menuBottomItems||[];this.notPublishedText=e.notPublishedText||null;this.access=e.access||{};this.articles=e.articles||[];this.editableTitle=null;this.editableUrl=null;this.leadership=null;this.popupHelper=null;this.popupStatus=null;this.popupConfig=null;this.loader=null;this.$container=null;this.$containerWrapper=null;this.$containerPreviewImage=null;this.$containerPreviewStatus=null;this.$containerPreviewShowPages=null;this.$containerPreviewInstruction=null;this.$containerInfo=null;this.$containerPhone=null;this.$containerTitle=null;this.$containerDomain=null;this.$containerDomainLink=null;this.$containerDomainStatus=null;this.$containerDomainStatusIcon=null;this.$containerDomainStatusTitle=null;this.$containerDomainStatusMessage=null;this.$containerSiteStatus=null;this.$containerSiteStatusRound=null;this.$containerSiteStatusTitle=null;this.$containerSiteMore=null;this.$containerLinks=null;this.bindEvents();this.lazyLoadCloudPreview=this.lazyLoadCloudPreview.bind(this)}babelHelpers.createClass(t,[{key:"bindEvents",value:function t(){var e=this;s.EventEmitter.subscribe("BX.Landing.SiteTile:showLeadership",(function(t){if(e===t.data){e.active();e.setContainerPosition()}if(e!==t.data){e.fade()}}));s.EventEmitter.subscribe("BX.Landing.SiteTile:hideLeadership",(function(t){if(e===t.data){e.unActive();e.unSetContainerPosition()}e.unFade()}));s.EventEmitter.subscribe(this.getPopupHelper(),"BX.Landing.SiteTile.Popup:onShow",(function(){e.getContainerWrapper().classList.add("--fade")}));s.EventEmitter.subscribe(this.getPopupHelper(),"BX.Landing.SiteTile.Popup:onHide",(function(){e.getContainerWrapper().classList.remove("--fade")}))}},{key:"setContainerPosition",value:function t(){var e=window.innerWidth-this.getContainer().getBoundingClientRect().right;var i=this.getLeadership().getContainer().offsetWidth;var n=this.getContainer().previousSibling;if(e>i){return}this.getContainer().style.transform="translateX(-"+(i+40-e)+"px)";if(n&&n.offsetTop===this.getContainer().offsetTop){n.style.transform="translateX(-10px)"}}},{key:"unSetContainerPosition",value:function t(){this.getContainer().style.transform=null;var e=this.getContainer().previousSibling;if(e&&e.offsetTop===this.getContainer().offsetTop){e.style.transform=null}}},{key:"updatePublishedStatus",value:function t(e){if(this.published===e){return}if(this.popupStatus){this.popupStatus.destroy()}this.popupStatus=null;if(e){this.published=true;this.getContainerSiteStatusRound().className="landing-sites__status-round --success";this.getContainerSiteStatusTitle().innerText=l.Loc.getMessage("LANDING_SITE_TILE_STATUS_PUBLISHED");this.getContainerPreviewImage().classList.remove("--not-published");this.getContainerPreviewStatus().classList.add("--hide");return}this.published=false;this.getContainerSiteStatusRound().className="landing-sites__status-round --alert";this.getContainerSiteStatusTitle().innerText=l.Loc.getMessage("LANDING_SITE_TILE_STATUS_NOT_PUBLISHED");this.getContainerPreviewImage().classList.add("--not-published");this.getContainerPreviewStatus().classList.remove("--hide")}},{key:"updateTitle",value:function t(e){if(e){this.title=e}}},{key:"updateUrl",value:function t(e){if(e){this.url=e}}},{key:"getContainerTitle",value:function t(){if(!this.$containerTitle){this.$containerTitle=l.Tag.render(x||(x=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__title">\n\t\t\t\t\t<div class="landing-sites__title-text">','</div>\n\t\t\t\t\t<div class="landing-sites__title-edit"></div>\n\t\t\t\t</div>\n\t\t\t'])),this.title)}return this.$containerTitle}},{key:"mergeMenuItems",value:function t(e){var i=this;var a=[{text:this.deleted?l.Loc.getMessage("LANDING_SITE_TILE_RESTORE"):l.Loc.getMessage("LANDING_SITE_TILE_REMOVE"),access:"delete",onclick:function t(){if(!i.deleted){var e=new n.MessageBox({title:l.Loc.getMessage("LANDING_SITE_TILE_DELETE_ALERT_TITLE"),message:l.Loc.getMessage("LANDING_SITE_TILE_DELETE_ALERT_MESSAGE"),buttons:BX.UI.Dialogs.MessageBoxButtons.OK_CANCEL,onOk:function t(){s.EventEmitter.emit("BX.Landing.SiteTile:remove",[i,e]);e.close()},popupOptions:{autoHide:true,closeByEsc:true,minHeight:false,minWidth:260,maxWidth:300,width:false,animation:"fading-slide"}});e.show()}else{s.EventEmitter.emit("BX.Landing.SiteTile:restore",i);i.getPopupConfig().close()}}}];e.map((function(t,e){if(t.delimiter===true);if(i.deleted){t.disabled=true}}));a.reverse().map((function(t){e.push(t)}));return e}},{key:"disableMenuItems",value:function t(e){var i=this;e=e.map((function(t){if(t.access&&i.access[t.access]!==true){t.disabled=true}return t}));return e}},{key:"getPopupConfig",value:function t(){var e=this;if(!this.popupConfig){this.popupConfig=new i.Menu({className:"landing-sites__status-popup",bindElement:this.getContainerSiteMore(),offsetLeft:-61,minWidth:220,closeByEsc:true,autoHide:true,angle:{offset:97},items:this.disableMenuItems(this.mergeMenuItems(this.menuItems)),events:{onPopupClose:function t(){e.getContainerSiteMore().classList.remove("--hover")},onPopupShow:function t(){e.getContainerSiteMore().classList.add("--hover")}},animation:"fading-slide"})}return this.popupConfig}},{key:"getPopupStatus",value:function t(){var e=this;if(!this.popupStatus){this.popupStatus=new i.Menu({className:"landing-sites__status-popup",bindElement:this.getContainerSiteStatus(),minWidth:220,closeByEsc:true,autoHide:true,angle:{offset:97},items:[{text:this.published?l.Loc.getMessage("LANDING_SITE_TILE_UNPUBLISH"):l.Loc.getMessage("LANDING_SITE_TILE_PUBLISH"),onclick:function t(){e.popupStatus.close();e.published?s.EventEmitter.emit("BX.Landing.SiteTile:unPublish",e):s.EventEmitter.emit("BX.Landing.SiteTile:publish",e)}}],events:{onPopupClose:function t(){e.getContainerSiteStatus().classList.remove("--hover")},onPopupShow:function t(){e.getContainerSiteStatus().classList.add("--hover")}},animation:"fading-slide"})}return this.popupStatus}},{key:"getContainerSiteStatus",value:function t(){var e=this;if(!this.$containerSiteStatus){this.$containerSiteStatus=l.Tag.render(B||(B=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="','">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),this.access.publication?"landing-sites__status":"landing-sites__status_disabled",this.getContainerSiteStatusRound(),this.getContainerSiteStatusTitle(),this.access.publication?l.Tag.render(M||(M=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__status-arrow"></div>']))):"");if(this.access.publication){l.Event.bind(this.$containerSiteStatus,"click",(function(t){e.getPopupStatus().layout.menuContainer.style.left=e.$containerSiteStatus.getBoundingClientRect().left+"px";e.getPopupStatus().show();t.stopPropagation()}))}}return this.$containerSiteStatus}},{key:"getContainerSiteMore",value:function t(){var e=this;if(!this.$containerSiteMore){this.$containerSiteMore=l.Tag.render(O||(O=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__more"></div>'])));l.Event.bind(this.$containerSiteMore,"click",(function(t){e.getPopupConfig().show();t.stopPropagation()}))}return this.$containerSiteMore}},{key:"getContainerSiteStatusRound",value:function t(){if(!this.$containerSiteStatusRound){var e=this.published?"--success":"--alert";this.$containerSiteStatusRound=l.Tag.render(A||(A=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__status-round ','"></div>'])),e)}return this.$containerSiteStatusRound}},{key:"getContainerSiteStatusTitle",value:function t(){if(!this.$containerSiteStatusTitle){var e=this.published?l.Loc.getMessage("LANDING_SITE_TILE_STATUS_PUBLISHED"):l.Loc.getMessage("LANDING_SITE_TILE_STATUS_NOT_PUBLISHED");this.$containerSiteStatusTitle=l.Tag.render(R||(R=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__status-title">',"</div>"])),e)}return this.$containerSiteStatusTitle}},{key:"publush",value:function t(){this.published=true;this.getContainerSiteStatusRound().className="landing-sites__status-round --success";this.getContainerSiteStatusTitle().innerText=l.Loc.getMessage("LANDING_SITE_TILE_STATUS_PUBLISHED");this.getContainerPreviewStatus().classList.add("--hide")}},{key:"unPublish",value:function t(){this.published=false;this.getContainerSiteStatusRound().className="landing-sites__status-round --alert";this.getContainerSiteStatusTitle().innerText=l.Loc.getMessage("LANDING_SITE_TILE_STATUS_NOT_PUBLISHED");this.getContainerPreviewStatus().classList.remove("--hide")}},{key:"getEditableTitle",value:function t(){if(!this.editableTitle){this.editableTitle=new h({phone:this.phone,type:"title",item:this,url:this.contactsUrl,disabled:!this.access.settings})}return this.editableTitle}},{key:"getContainerInfo",value:function t(){if(!this.$containerInfo){this.$containerInfo=l.Tag.render(G||(G=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__container --white-bg">\n\t\t\t\t\t<div class="landing-sites__container-left">\n\t\t\t\t\t\t<div class="landing-sites__title">\n\t\t\t\t\t\t\t<div class="landing-sites__title-text" title="','">',"</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t",'\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="landing-sites__container-right">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),l.Text.encode(this.title),l.Text.encode(this.title),this.phone?this.getEditableTitle().getContainer():"",this.getContainerSiteStatus(),this.getContainerSiteMore())}return this.$containerInfo}},{key:"updateDomainStatus",value:function t(e,i){!e?e="":null;this.getContainerDomainStatus().className="landing-sites__container-status --"+e;!i?i="":null;this.updateDomainStatusMessage(i)}},{key:"getContainerDomainStatus",value:function t(){if(!this.$containerDomainStatus){this.$containerDomainStatus=l.Tag.render(j||(j=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__container-status --','"></div>\n\t\t\t'])),this.domainStatus)}return this.$containerDomainStatus}},{key:"getEditableUrl",value:function t(){if(!this.editableUrl){this.editableUrl=new h({title:this.url,type:"url",item:this,url:this.domainUrl,disabled:!this.access.settings})}return this.editableUrl}},{key:"getContainerDomainStatusIcon",value:function t(){if(!this.$containerDomainStatusIcon){this.$containerDomainStatusIcon=l.Tag.render(X||(X=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__status-icon --','"></div>\n\t\t\t'])),this.domainStatus)}return this.$containerDomainStatusIcon}},{key:"getContainerDomainStatusTitle",value:function t(){if(!this.$containerDomainStatusTitle){var e=l.Loc.getMessage("LANDING_SITE_TILE_OPEN");this.$containerDomainStatusTitle=l.Tag.render(K||(K=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__status-title">\n\t\t\t\t\t',"\n\t\t\t\t</div>"])),e)}return this.$containerDomainStatusTitle}},{key:"updateDomainStatusMessage",value:function t(e){!e?e="":null;this.getContainerDomainStatusMessage().innerText=e;this.domainStatusMessage=e}},{key:"getContainerDomainStatusMessage",value:function t(){if(!this.$containerDomainStatusMessage){!this.domainStatusMessage?this.domainStatusMessage="":null;this.$containerDomainStatusMessage=l.Tag.render(W||(W=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__sub-title">',"</div>\n\t\t\t"])),this.domainStatusMessage)}return this.$containerDomainStatusMessage}},{key:"getContainerDomainLink",value:function t(){var e=this;if(!this.$containerDomainLink){this.$containerDomainLink=l.Tag.render(F||(F=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__status landing-sites__status-','">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),this.id,this.getContainerDomainStatusIcon(),this.getContainerDomainStatusTitle());l.Event.bind(this.$containerDomainLink,"click",(function(){e.getPopupHelper().show(e.published?"link":"notPublished")}))}return this.$containerDomainLink}},{key:"getContainerDomain",value:function t(){if(!this.$containerDomain){this.$containerDomain=l.Tag.render(Q||(Q=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__container --white-bg --white-bg--alpha --domain">\n\t\t\t\t\t','\n\t\t\t\t\t<div class="landing-sites__container-left">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t",'\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="landing-sites__container-right">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),this.getContainerDomainStatus(),this.getEditableUrl().getContainer(),this.getContainerDomainStatusMessage(),this.getContainerDomainLink())}return this.$containerDomain}},{key:"getContainerPreviewImage",value:function t(){if(!this.$containerPreviewImage){this.$containerPreviewImage=l.Tag.render(z||(z=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__preview-image ','"></div>'])),this.published?"":"--not-published");this.$containerPreviewImage.style.backgroundImage="url("+this.preview+")";this.$containerPreviewImage.style.backgroundSize="cover";if(this.published&&this.cloudPreview&&this.cloudPreview!==this.preview){this.lazyLoadCloudPreview()}}return this.$containerPreviewImage}},{key:"lazyLoadCloudPreview",value:function t(){var e=this;var i=this.cloudPreview+(this.cloudPreview.indexOf("?")>0?"&":"?")+"refreshed"+(Date.now()/864e5|0);var n=new XMLHttpRequest;n.open("HEAD",i);n.onload=function(){var t=n.getResponseHeader("expires");if(t&&new Date(t)<=new Date){setTimeout(e.lazyLoadCloudPreview,3e3)}else{e.$containerPreviewImage.style.backgroundImage="url("+i+")"}};n.send()}},{key:"getContainerPreviewStatus",value:function t(){var e=this;if(!this.$containerPreviewStatus){this.$containerPreviewStatus=l.Tag.render(Y||(Y=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__preview-status --not-published ','">\n\t\t\t\t\t<div class="landing-sites__preview-status-wrapper">\n\t\t\t\t\t\t<div class="landing-sites__preview-status-icon"></div>\n\t\t\t\t\t\t<div class="landing-sites__preview-status-text">\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),this.published?"--hide":"",l.Loc.getMessage("LANDING_SITE_TILE_STATUS_NOT_PUBLISHED"));l.Event.bind(this.$containerPreviewStatus,"mouseenter",(function(){e.$containerPreviewStatus.style.width=e.$containerPreviewStatus.firstElementChild.offsetWidth+"px"}));l.Event.bind(this.$containerPreviewStatus,"mouseleave",(function(){e.$containerPreviewStatus.style.width=null}))}return this.$containerPreviewStatus}},{key:"getContainerPreviewShowPages",value:function t(){if(!this.$containerPreviewShowPages){this.$containerPreviewShowPages=l.Tag.render(q||(q=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__preview-show">\n\t\t\t\t\t',"\n\t\t\t\t</div>\n\t\t\t"])),l.Loc.getMessage("LANDING_SITE_TILE_SHOW_PAGES"))}return this.$containerPreviewShowPages}},{key:"getContainerPreviewInstruction",value:function t(){var e=this;if(!this.$containerPreviewInstruction){this.$containerPreviewInstruction=l.Tag.render(V||(V=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__preview-leadership">\n\t\t\t\t\t<div class="landing-sites__preview-leadership-text">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),l.Loc.getMessage("LANDING_SITE_TILE_INSTRUCTION"));l.Event.bind(this.$containerPreviewInstruction,"click",(function(){e.getLeadership().show()}))}return this.$containerPreviewInstruction}},{key:"getContainerLinks",value:function t(){var e=this;if(!this.$containerLinks){this.$containerLinks=l.Tag.render(J||(J=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__container --without-bg --auto-height --flex"></div>'])));this.menuBottomItems.map((function(t){e.$containerLinks.appendChild(e.getContainerLinksItem(t.code,t.href,t.text))}))}return this.$containerLinks}},{key:"getContainerLinksItem",value:function t(e,i,n){var a=this;var r=l.Tag.render(Z||(Z=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<a href="','" class="landing-sites__container-link landing-sites__container-link-',' --white-bg--alpha">\n\t\t\t\t<div class="landing-sites__container-link-icon --','"></div>\n\t\t\t\t<div class="landing-sites__container-link-text">',"</div>\n\t\t\t</a>\n\t\t"])),i,this.id,e,n);l.Event.bind(r,"click",(function(t){s.EventEmitter.emit("BX.Landing.SiteTile:onBottomMenuClick",[e,t,a])}));return r}},{key:"getLeadership",value:function t(){if(!this.leadership){this.leadership=new T({id:this.id,item:this,articles:this.articles})}return this.leadership}},{key:"remove",value:function t(){var e=this;this.getContainer().classList.add("--remove");l.Event.bind(this.getContainer(),"transitionend",(function(){var t=e.grid.getItems();t.splice(t.indexOf(t),1);l.Dom.remove(e.getContainer())}))}},{key:"lock",value:function t(){this.getContainer().classList.add("--lock");if(!this.loader){this.loader=new BX.Loader({target:this.getContainer(),size:100})}this.loader.show()}},{key:"unLock",value:function t(){this.getContainer().classList.remove("--lock");if(this.loader){this.loader.hide()}}},{key:"fade",value:function t(){this.getContainer().classList.add("--fade")}},{key:"unFade",value:function t(){this.getContainer().classList.remove("--fade")}},{key:"active",value:function t(){this.getContainer().classList.add("--active")}},{key:"unActive",value:function t(){this.getContainer().classList.remove("--active")}},{key:"getPopupHelper",value:function t(){if(!this.popupHelper){this.popupHelper=new H({id:this.id,url:this.url,itemObj:this,fullUrl:this.fullUrl,ordersUrl:this.ordersUrl,indexEditUrl:this.indexEditUrl,notPublishedText:this.notPublishedText})}return this.popupHelper}},{key:"getContainerWrapper",value:function t(){if(!this.$containerWrapper){this.$containerWrapper=l.Tag.render(tt||(tt=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__item-container">\n\t\t\t\t\t<a href="','" class="landing-sites__preview">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t</a>\n\t\t\t\t\t","\n\t\t\t\t\t","\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),this.pagesUrl,this.getContainerPreviewImage(),this.getContainerPreviewStatus(),this.getContainerPreviewShowPages(),this.articles.length>0?this.getContainerPreviewInstruction():"",this.getContainerInfo(),this.getContainerDomain(),this.getContainerLinks())}return this.$containerWrapper}},{key:"getContainer",value:function t(){if(!this.$container){this.$container=l.Tag.render(et||(et=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__grid-item ','">\n\t\t\t\t\t<div class="landing-sites__item" id="landing-sites__grid-item--','">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),this.deleted?"--deleted":"",this.id,this.getLeadership().getContainer(),this.getContainerWrapper(),this.getPopupHelper().getContainer())}return this.$container}}]);return t}();var nt,st;var at=function(){function t(e){babelHelpers.classCallCheck(this,t);this.id=e.id;this.grid=e.grid;this.title=e.title;this.text=e.text;this.buttonText=e.buttonText;this.url=e.url;this.onClick=e.onClick;this.$container=null}babelHelpers.createClass(t,[{key:"getButton",value:function t(){var e=l.Tag.render(nt||(nt=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<span class="ui-btn ui-btn-light-border ui-btn-round" href="#">',"</span>\n\t\t"])),this.buttonText);if(this.onClick){l.Event.bind(e,"click",this.onClick)}return e}},{key:"getContainer",value:function t(){if(!this.$container){this.$container=l.Tag.render(st||(st=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__grid-item">\n\t\t\t\t\t<div class="landing-sites__item --marketing">\n\t\t\t\t\t\t<div class="landing-sites__item-container --flex">\n\t\t\t\t\t\t\t<div class="landing-sites__item-marketing--title">','</div>\n\t\t\t\t\t\t\t<div class="landing-sites__item-marketing--text">','</div>\n\t\t\t\t\t\t\t<div class="landing-sites__item-marketing--icon"></div>\n\t\t\t\t\t\t\t<div class="landing-sites__item-marketing--buttons">\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),this.title,this.text,this.getButton())}return this.$container}}]);return t}();var lt;var rt=function(){function t(e){babelHelpers.classCallCheck(this,t);this.grid=e.grid;this.scrollerText=e.scrollerText;this.$container=null;this.$lastItem=null;this.bindEvents();this.init()}babelHelpers.createClass(t,[{key:"bindEvents",value:function t(){l.Event.bind(window,"scroll",this.adjustPosition.bind(this))}},{key:"show",value:function t(){if(!this.getContainer().classList.contains("--show")){this.getContainer().classList.remove("--hide");this.getContainer().classList.add("--show")}}},{key:"hide",value:function t(){if(!this.getContainer().classList.contains("--hide")){this.getContainer().classList.remove("--show");this.getContainer().classList.add("--hide")}}},{key:"adjustPosition",value:function t(){if(!this.$lastItem){this.$lastItem=this.grid.getItems()[this.grid.getItems().length-1].getContainer()}this.$lastItem.getBoundingClientRect().top>document.documentElement.clientHeight?this.show():this.hide()}},{key:"getContainer",value:function t(){var e=this;if(!this.$container){this.$container=l.Tag.render(lt||(lt=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-sites__scroller landing-sites__scope">\n\t\t\t\t\t<div class="landing-sites__scroller-button">\n\t\t\t\t\t\t<div class="landing-sites__scroller-icon"></div>\n\t\t\t\t\t\t<div class="landing-sites__scroller-text">\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),this.scrollerText?this.scrollerText:l.Loc.getMessage("LANDING_SITE_TILE_SCROLLER_SITES"));l.Event.bind(this.$container,"click",(function(){var t=window.pageYOffset;var i=setInterval((function(){if(window.pageYOffset+30>=e.$lastItem.getBoundingClientRect().top+window.pageYOffset-document.body.clientTop||window.pageYOffset+window.innerHeight>=document.body.scrollHeight){clearInterval(i)}t=t+10;window.scrollTo(0,t)}),10)}))}return this.$container}},{key:"init",value:function t(){document.body.appendChild(this.getContainer());this.adjustPosition()}}]);return t}();var ot;var dt=function(){function t(e){babelHelpers.classCallCheck(this,t);this.renderTo=e.renderTo||null;this.items=e.items||[];this.scrollerText=e.scrollerText||null;this.notPublishedText=e.notPublishedText||null;this.siteTileItems=[];this.$container=null;this.scroller=null;this.setData(this.items);this.init()}babelHelpers.createClass(t,[{key:"getItems",value:function t(){return this.siteTileItems}},{key:"setData",value:function t(e){var i=this;this.siteTileItems=e.map((function(t){if(t.type==="itemMarketing"){return new at({id:t.id||null,title:t.title||null,text:t.text||null,buttonText:t.buttonText||null,onClick:t.onClick||null})}return new it({id:t.id||null,title:t.title||null,url:t.url||null,fullUrl:t.fullUrl||null,domainProvider:t.domainProvider||null,pagesUrl:t.pagesUrl||null,ordersUrl:t.ordersUrl||null,domainUrl:t.domainUrl||null,contactsUrl:t.contactsUrl||null,indexEditUrl:t.indexEditUrl||null,ordersCount:parseInt(t.ordersCount)||null,phone:t.phone||null,preview:t.preview||null,cloudPreview:t.cloudPreview||null,published:t.published||null,deleted:t.deleted||null,domainStatus:t.domainStatus||null,domainStatusMessage:t.domainStatusMessage||null,menuItems:t.menuItems||null,menuBottomItems:t.menuBottomItems||null,notPublishedText:i.notPublishedText||null,access:t.access||{},articles:t.articles||null,grid:i})}));return this.siteTileItems}},{key:"getContainer",value:function t(){if(!this.$container){this.$container=l.Tag.render(ot||(ot=babelHelpers.taggedTemplateLiteral(['<div class="landing-sites__grid landing-sites__scope"></div>'])));for(var e=0;e<this.siteTileItems.length;e++){this.$container.appendChild(this.siteTileItems[e].getContainer())}}return this.$container}},{key:"draw",value:function t(){if(this.renderTo){this.renderTo.appendChild(this.getContainer())}this.afterDraw()}},{key:"afterDraw",value:function t(){if(this.getItems().length>4){if(!this.scroller){this.scroller=new rt({grid:this,scrollerText:this.scrollerText})}}}},{key:"init",value:function t(){this.draw()}}]);return t}();t.SiteTile=dt})(this.BX.Landing.Component=this.BX.Landing.Component||{},BX,BX.Main,BX.UI.Dialogs,BX.Event,BX,BX);
//# sourceMappingURL=script.map.js